AliAnalysisTask *AddTask_xlu_TRDdEdx()
{
  char *tkn0 = "TRDdEdx";

  //---  
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    Error(From("AddTask_xlu_%s",tkn0), "No analysis manager found.");
    return 0;
  }

  AliAnalysisTaskTRDdEdx *mytask = new AliAnalysisTaskTRDdEdx;

  //mytask->SelectCollisionCandidates(AliVEvent::kMB);
  mytask->SelectCollisionCandidates(AliVEvent::kAnyINT|AliVEvent::kTRD);
  
  mgr->AddTask(mytask);

  //---  
  AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
  mgr->ConnectInput(mytask,  0, cinput );
  
  Char_t foutname[100];
  sprintf(foutname,"xlu_%s.root",tkn0);

  AliAnalysisDataContainer *outlist1 = mgr->CreateContainer("xlutree", TTree::Class(), AliAnalysisManager::kOutputContainer,foutname);

  AliAnalysisDataContainer *outlist2 = mgr->CreateContainer("xlulist",  TList::Class(), AliAnalysisManager::kOutputContainer,foutname);

  //in AnalysisTaskSE, slot 0 reserved, must start from 1
  mytask->ConnectOutput(1, outlist1);
  mytask->ConnectOutput(2, outlist2);

  return mytask;
}
